﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace EasySL.Entity
{
    public class Product : EntityBase,  INotifyPropertyChanged
    {
        //public string Name { get; set; }
        //public int Price { get; set; }
        //public Category Category { get; set; }
        //public string Info { get; set; }

        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; NotifyPropertyChanged("Name"); }
        }

        private int price;
        public int Price
        {
            get { return price; }
            set { price = value; NotifyPropertyChanged("Price"); }
        }

        private Category category;
        public Category Category
        {
            get { return category; }
            set { category = value; NotifyPropertyChanged("Category"); }
        }

        private string info;
        public string Info
        {
            get { return info; }
            set { info = value; NotifyPropertyChanged("Info"); }
        }
        
        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }


        #endregion
    }
}
